// iomanip standard header
#pragma once
#ifndef _IOMANIP_
#define _IOMANIP_
#ifndef RC_INVOKED
#include <istream>

#ifdef _MSC_VER
 #pragma pack(push,_CRT_PACKING)
 #pragma warning(push,3)
#endif  /* _MSC_VER */
_STD_BEGIN

		// TEMPLATE STRUCT _Fillobj
template<class _Elem>
	struct _Fillobj
	{	// store fill character
	_Fillobj(_Elem _Ch)
		: _Fill(_Ch)
		{	// construct from fill character
		}

	_Elem _Fill;	// the fill character
	};

		// TEMPLATE FUNCTION setfill
template<class _Elem> inline
	_Fillobj<_Elem> __CLRCALL_OR_CDECL setfill(_Elem _Ch)
	{	// return a _Fillobj manipulator
	return (_Fillobj<_Elem>(_Ch));
	}

template<class _Elem,
	class _Traits> inline
	basic_istream<_Elem, _Traits>&
		__CLRCALL_OR_CDECL operator>>(basic_istream<_Elem, _Traits>& _Istr,
			const _Fillobj<_Elem>& _Manip)
	{	// set fill character in input stream
	_Istr.fill(_Manip._Fill);
	return (_Istr);
	}

template<class _Elem,
	class _Traits> inline
	basic_ostream<_Elem, _Traits>&
		__CLRCALL_OR_CDECL operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
			const _Fillobj<_Elem>& _Manip)
	{	// set fill character in output stream
	_Ostr.fill(_Manip._Fill);
	return (_Ostr);
	}

		// TEMPLATE STRUCT _Smanip
template<class _Arg>
	struct _Smanip
	{	// store function pointer and argument value
	_Smanip(void (__cdecl *_Left)(ios_base&, _Arg), _Arg _Val)
		: _Pfun(_Left), _Manarg(_Val)
		{	// construct from function pointer and argument value
		}

	void (__cdecl *_Pfun)(ios_base&, _Arg);	// the function pointer
	_Arg _Manarg;	// the argument value
	};

template<class _Elem,
	class _Traits,
	class _Arg> inline
	basic_istream<_Elem, _Traits>& __CLRCALL_OR_CDECL operator>>(
		basic_istream<_Elem, _Traits>& _Istr, const _Smanip<_Arg>& _Manip)
	{	// extract by calling function with input stream and argument
	(*_Manip._Pfun)(_Istr, _Manip._Manarg);
	return (_Istr);
	}

template<class _Elem,
	class _Traits,
	class _Arg> inline
	basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL operator<<(
		basic_ostream<_Elem, _Traits>& _Ostr, const _Smanip<_Arg>& _Manip)
	{	// insert by calling function with output stream and argument
	(*_Manip._Pfun)(_Ostr, _Manip._Manarg);
	return (_Ostr);
	}

		// INSTANTIATIONS
_MRTIMP2 _Smanip<ios_base::fmtflags> __cdecl resetiosflags(ios_base::fmtflags);
_MRTIMP2 _Smanip<ios_base::fmtflags> __cdecl setiosflags(ios_base::fmtflags);
_MRTIMP2 _Smanip<int> __cdecl setbase(int);
_MRTIMP2 _Smanip<streamsize> __cdecl setprecision(streamsize);
_MRTIMP2 _Smanip<streamsize> __cdecl setw(streamsize);
_STD_END
#ifdef _MSC_VER
 #pragma warning(pop)
 #pragma pack(pop)
#endif  /* _MSC_VER */

#endif /* RC_INVOKED */
#endif /* _IOMANIP_ */

/*
 * Copyright (c) 1992-2006 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
 V5.02:0009 */
